import os
import fcntl


def non_blocking_stream(stream):
	fd = stream.fileno()
	fl = fcntl.fcntl(fd, fcntl.F_GETFL)
	fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
	return stream


